package com.cheng.example.atguigu.design_pattern.strategy.imporve;

/*
 * @author 程帅
 * @createTime: 2020/10/19 13:19
 * @Created: with IntelliJ IDEA.
 */
public abstract class Duck {

    //属性，策略接口
    FlyBehavior flyBehavior;
    //其他属性<->策略接口

    public abstract void display();//显示鸭子信息

    public void fly() {
        //改进
        if (flyBehavior != null) {
            flyBehavior.fly();
        }
    }


}
